/*=============================================================================
*
*   Copyright (C) 2020 All rights reserved.
*
*   Filename:		main.cpp
*
*   Author: Wang Zhecheng - wangzhecheng@yeah.net
*
*   Date: 2020-02-20 21:23
*
*   Last Editors: Wang Zhecheng - wangzhecheng@yeah.net
*
*   Last modified:	2020-03-16 10:30
*
*   Description:
*
=============================================================================*/
#include "../include/fem.hpp"
#include "../include/implicit_solver.hpp"
#include "../include/incremental_load.hpp"
#include "../include/model/model.hpp"
#include "../include/solid.hpp"
#include "../include/static_equation.hpp"

LOGGING_REGISTER();

int main(int argc, char* argv[]) {

  /*  detail, trace, process, info, warning, debug, error */
  geoxfem::log::log_init(geoxfem::log::severity_level::info);

  using MethodPolicy   = geoxfem::model::fem;
  using CouplePolicy   = geoxfem::model::solid;
  using DimensionType  = geoxfem::geometry::plane_stress;
  using EquationPolicy = geoxfem::model::static_equation;
  using SolvePolicy    = geoxfem::model::implicit_solver;
  using LoadPolicy     = geoxfem::model::incremental_load;

  geoxfem::model::Model<MethodPolicy, CouplePolicy, DimensionType,
                        EquationPolicy, SolvePolicy, LoadPolicy, mpl1>
    model;

  std::string input_file_name = (argc == 1) ? "demo/try.json" : argv[1];

  model.read(input_file_name);
  model.buildProblem();
  /* geoxfem::io::DataPloter plt; */
  /* model.getMesh()->plot(plt); */
  model.solveProblem();

  return 0;
}